<template>
  <div id="app">
    <transition :name="transitionName">
      <router-view class="child-view">

      </router-view>
    </transition>
    <com-footer></com-footer>
  </div>
</template>

<script>
import Header from "./components/Header";
import Footer from "./components/Footer";

export default {
  name: "app",
  components: {
    comHeader: Header,
    comFooter: Footer
  },
  data() {
    return {
      transitionName: "slide-left"
    };
  },
  watch: {
    $route(to, from) {
      if (to.path == "/") {
        this.transitionName = "slide-right";
      } else {
        this.transitionName = "slide-left";
      }
    }
  }
};
</script>

<style>
*,
*:active,
*:active,
*:link {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-tap-highlight-color: transparent;
  /* tap-highlight-color: rgba(0, 0, 0, 0); */
  /* tap-highlight-color: transparent; */
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}
ol,
ul,
li {
  list-style: none outside none;
}
dd,
dl,
li,
ol,
ul {
  margin: 0;
  padding: 0;
}
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  height: 100%;
}
.child-view {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  /* min-height: calc(100% - 95px); */
  height: calc(100% - 55px);
  overflow-y: auto;
  transition: all 0.3s cubic-bezier(0.55, 0, 0.1, 1);
}
.slide-left-enter,
.slide-right-leave-active {
  opacity: 0;
  -webkit-transform: translate(30px, 0);
  transform: translate(30px, 0);
}
.slide-left-leave-active,
.slide-right-enter {
  opacity: 0;
  -webkit-transform: translate(-30px, 0);
  transform: translate(-30px, 0);
}
</style>
